<#include "/page/admin/common/_layout.html"/>
<@layout page_tab="index">
<link rel="stylesheet" href="${baseUrl!}/static/css/highlight.css">
<script src="${baseUrl!}/static/js/marked.min.js"></script>
<script src="${baseUrl!}/static/js/highlight.min.js"></script>
<div class="row">
    <div class="col-md-6">
        <div class="panel panel-default">
            <div class="panel-heading">今日话题 <span class="pull-right">共${topics.size()}条</span></div>
            <table class="table">
                <#list topics as topic>
                    <tr>
                        <td><a href="${baseUrl!}/topic/${topic.id!}.html" target="_blank">${topic.title!}</a></td>
                        <td width="62">${topic.in_time?time}</td>
                    </tr>
                </#list>
            </table>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">今日用户 <span class="pull-right">共${users.size()}条</span></div>
            <table class="table">
                <tr>
                    <th>昵称</th>
                    <th>邮箱</th>
                    <th>QQ昵称</th>
                    <th>微博昵称</th>
                    <th>时间</th>
                </tr>
                <#list users as user>
                    <tr>
                        <td>${user.nickname!}</td>
                        <td><a href="mailto:${user.email!}">${user.email}</a></td>
                        <td>${user.qq_nickname!}</td>
                        <td>${user.sina_nickname!}</td>
                        <td width="62">${user.in_time?time}</td>
                    </tr>
                </#list>
            </table>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">今日签到 <span class="pull-right">共${missions.size()}条</span></div>
            <table class="table">
                <tr>
                    <th>昵称</th>
                    <th>得分</th>
                    <th>总分</th>
                    <th>天数</th>
                    <th>时间</th>
                </tr>
                <#list missions as mission>
                    <tr>
                        <td>${mission.nickname!}</td>
                        <td>${mission.score}</td>
                        <td>${mission.totalScore}</td>
                        <td>连续${mission.day}天</td>
                        <td width="62">${mission.in_time?time}</td>
                    </tr>
                </#list>
            </table>
        </div>
    </div>
    <div class="col-md-6">
        <div class="panel panel-default">
            <div class="panel-heading">今日回复 <span class="pull-right">共${replies.size()}条</span></div>
            <table class="table">
                <#list replies as reply>
                    <tr>
                        <td <#if reply.isdelete == 1> class="np-label-del" </#if>>
                            <a href="javascript:;" data-toggle="modal" data-target="#reply_${reply.id!}">${reply.title!}</a>
                            <div class="modal fade" id="reply_${reply.id!}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                                <div class="modal-dialog" role="document">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                            <h4 class="modal-title" id="myModalLabel">${reply.title!}</h4>
                                        </div>
                                        <div class="modal-body">
                                            <textarea class="reply_content">${reply.content!}</textarea>
                                        </div>
                                        <div class="modal-footer">
                                            <a href="${baseUrl!}/topic/${reply.tid!}.html#${reply.id!}" target="_blank" class="btn btn-default">查看</a>
                                            <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </td>
                        <td width="62">${reply.in_time?time}</td>
                    </tr>
                </#list>
            </table>
        </div>
    </div>
</div>
<script>
    $(function () {
        $(".reply_content").each(function (i, item) {
            $(this).parent().html(marked($(this).text()));
        })
    })
</script>
</@layout>
